
#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>

#include "bluetooth/ble.h"

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE
#ifndef TIMEMS
#define TIMEMS qPrintable(QTime::currentTime().toString("HH:mm:ss zzz"))
#endif
class MainWindow : public QMainWindow

{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

private slots:
    void on_pushButton_scan_clicked();

    void on_pushButton_connect_clicked();

    void on_pushButton_service_clicked();

private:
    Ui::MainWindow *ui;
    BLE * m_ble;
    void append(int type, const QString &data, bool clear = false);
private slots:
    void deal_bluetooth_data(const QByteArray &data);
    void on_bt_send_clicked();
};

#endif // MAINWINDOW_H
